package com.ethink.warehouse.facade.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.warehouse.api.LogisticsTraceOrderFacade;
import com.ethink.warehouse.api.info.LogisticsStepInfo;
import com.ethink.warehouse.api.request.*;
import com.ethink.warehouse.api.response.*;
import com.ethink.warehouse.manager.LogisticsStepManager;
import com.ethink.warehouse.service.LogisticsTraceOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 物流跟进单 Facade接口实现
 *
 * @author default
 * @date 2022-11-10
 */
@RestController
@Slf4j
@RequestMapping("warehouse-service/facade/v1/logisticsTraceOrder")
public class LogisticsTraceOrderFacadeImpl implements LogisticsTraceOrderFacade {

    @Autowired
    private LogisticsTraceOrderService logisticsTraceOrderService;

    @Autowired
    private LogisticsStepManager logisticsManager;

    @Override
    public Page<LogisticsTraceOrderQueryResponse> queryLogisticsTraceOrder(LogisticsTraceOrderQueryRequest request) {
        return logisticsTraceOrderService.queryLogisticsTraceOrder(request);
    }

    @Override
    public Page<LogisticsTraceOrderQueryGoodsModeResponse> queryLogisticsTraceOrderGoodsMode(LogisticsTraceOrderQueryGoodsModeRequest request) {
        return logisticsTraceOrderService.queryLogisticsTraceOrderGoodsMode(request);
    }

    @Override
    public LogisticsTraceOrderGetDetailResponse getLogisticsTraceOrderById(Long logisticsTraceOrderId) {
        return logisticsTraceOrderService.getLogisticsTraceOrderById(logisticsTraceOrderId);
    }

    @Override
    public List<LogisticsTraceOrderListRkConfirmDetailResponse> listLogisticsTraceOrderRkConfirmDetail(Long logisticsTraceOrderId) {
        return logisticsTraceOrderService.listLogisticsTraceOrderRkConfirmDetail(logisticsTraceOrderId);
    }


    @Override
    public LogisticsTraceOrderAddResponse addLogisticsTraceOrder(LogisticsTraceOrderAddRequest request) {
        return logisticsTraceOrderService.addLogisticsTraceOrder(request);
    }

    @Override
    public void updateLogisticsTraceOrder(LogisticsTraceOrderUpdateRequest request) {
        logisticsTraceOrderService.updateLogisticsTraceOrder(request);
    }

    @Override
    public LogisticsTraceOrderUpdateStepResponse updateLogisticsTraceOrderStep(LogisticsTraceOrderUpdateStepRequest request) {
        return logisticsTraceOrderService.updateLogisticsTraceOrderStep(request);
    }

    @Override
    public void backLogisticsTraceOrderPreviousStep(LogisticsTraceOrderBackPreviousStepRequest request) {
        logisticsTraceOrderService.backLogisticsTraceOrderPreviousStep(request);
    }

    @Override
    public void deleteLogisticsTraceOrder(Long logisticsTraceOrderId) {
        logisticsTraceOrderService.deleteLogisticsTraceOrder(logisticsTraceOrderId);
    }

    @Override
    public void submitLogisticsTraceOrderOA(LogisticsTraceOrderOaSubmitRequest request) {
        logisticsTraceOrderService.submitLogisticsTraceOrderOA(request);
    }

    @Override
    public void approvedLogisticsTraceOrderOA(LogisticsTraceOrderOaApprovedRequest request) {
        logisticsTraceOrderService.approvedLogisticsTraceOrderOA(request);
    }

    @Override
    public List<LogisticsStepInfo> getLogisticsStepList(LogisticsStepListGetRequest request) {
        return logisticsManager.getLogisticsStepList(request);
    }

}